package com.ezandroid.library.network.http.ssl;

import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSession;

/**
 * Trusted all host name verifier.
 *
 * @author markmjw
 * @date 2015-05-29
 */
public class TrustedHostnameVerifier {
    private static HostnameVerifier sTrustedVerifier;

    public static HostnameVerifier getTrustedVerifier() {
        if (sTrustedVerifier == null) {
            sTrustedVerifier = new HostnameVerifier() {
                @Override
                public boolean verify(String hostname, SSLSession session) {
                    return true;
                }
            };
        }
        return sTrustedVerifier;
    }
}
